package offer;

/**
 * @Author SSK
 * @Date Created in 19:21 2019/8/4
 * @Description 不用加减乘除做加法
 * @Version 1.0
 */
public class T49 {
    public int Add(int num1,int num2) {
        int  ans = num1^num2;
        int jw = (num1&num2) << 1;
        while (jw!=0) {
            int temp = jw & ans;
            ans = jw ^ ans;
            jw = temp << 1;
        }
        return ans;
    }
    public static void main ( String[] args) {
        System.out.println(new T49().Add(3,8));

    }
}
